﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;

namespace LayoutTemplate
{
    public class DataProvider
    {
        public SqlConnection _con;
        public DataProvider()
        {
            string _data = System.Web.HttpContext.Current.Server.MapPath("~/App_Data/WebApp.mdf");
            string _conString = "Data Source=.\\SQLEXPRESS;AttachDbFilename=" + _data + ";Integrated Security=True;User Instance=True";
            _con = new SqlConnection();
            _con.ConnectionString = _conString;
            _con.Open();
        }
        ~DataProvider()
        {
            _con.Close();
        }
    }
}
